export default {
  inserted(el, binding, value, oldValue){
    //addEventListener只针对IE11以上，
    window.addEventListener('scroll', function () {
      let scrollTop = document.documentElement.scrollTop
      let target = el
      if (scrollTop >= 450 ){
        let cls = target.getAttribute('class')
        cls += " nav-bg"
        target.setAttribute('class', cls)
      }else {
        target.setAttribute('class', 'nav')
      }
    }, false)
  }
}
